home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / cmds / makeindex / genind.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-04-26  |  1.6 KB  |  86 lines

  1. /*
  2.  *
  3.  * Copyright (C) 1987     Pehong Chen    (phc@renoir.berkeley.edu)
  4.  * Computer Science Division
  5.  * University of California, Berkeley
  6.  *
  7.  */
  8.  
  9. #if    KCC_20
  10. /* KCC preprocessor bug collapses multiple blanks to single blank */
  11. #define IND_ERROR(F, D)    { \
  12.     if (idx_dot) { \
  13.         fprintf(ilg_fp, "\n"); \
  14.         idx_dot = FALSE; \
  15.     } \
  16.     fprintf(ilg_fp, "## Warning (input = %s, line = %d; output = %s, line = %d):\n\040\040 -- ", \
  17.             curr->fn, curr->lc, ind_fn, ind_lc+1); \
  18.     fprintf(ilg_fp, F, D); \
  19.     ind_ec++; \
  20. }
  21. #else
  22. #define IND_ERROR(F, D)    { \
  23.     if (idx_dot) { \
  24.         fprintf(ilg_fp, "\n"); \
  25.         idx_dot = FALSE; \
  26.     } \
  27.     fprintf(ilg_fp, "## Warning (input = %s, line = %d; output = %s, line = %d):\n   -- ", \
  28.             curr->fn, curr->lc, ind_fn, ind_lc+1); \
  29.     fprintf(ilg_fp, F, D); \
  30.     ind_ec++; \
  31. }
  32. #endif
  33.  
  34.  
  35. #define    PUTC(C) { \
  36.     fprintf(ind_fp, "%c", C); \
  37. }
  38.  
  39. #define    PUT(S) { \
  40.     fprintf(ind_fp, S); \
  41. }
  42.  
  43. #define PUTLN(S) { \
  44.     fprintf(ind_fp, "%s\n", S); \
  45.     ind_lc++; \
  46. }
  47.  
  48. #define    SAVE { \
  49.     begin = end = curr; \
  50.     prev_encap = encap; \
  51. }
  52.  
  53. #define LETTERHEAD { \
  54.     if (lethead_flag) { \
  55.         PUT(lethead_pre); \
  56.         ind_lc += headprelen; \
  57.         switch (curr->group) { \
  58.         case SYMBOL: \
  59.             if (lethead_flag > 0) { \
  60.                 PUT("Symbols"); \
  61.             } else { \
  62.                 PUT("symbols"); \
  63.             } \
  64.             break; \
  65.         case ALPHA: \
  66.             if (lethead_flag > 0) { \
  67.                 let = TOUPPER(let);  \
  68.                 PUTC(let); \
  69.             } else { \
  70.                 let = TOLOWER(let);  \
  71.                 PUTC(let); \
  72.             } \
  73.             break; \
  74.         default: \
  75.             if (lethead_flag > 0) { \
  76.                 PUT("Numbers"); \
  77.             } else { \
  78.                 PUT("numbers"); \
  79.             } \
  80.             break; \
  81.         } \
  82.         PUT(lethead_suf); \
  83.         ind_lc += headsuflen; \
  84.     } \
  85. }
  86.